<div class="crumb-wrap">
    <div class="crumb-list"><i class="icon-font"></i><a href="<?=site_url('admini')?>">首页</a>
        <span class="crumb-step">&gt;</span><a class="crumb-name" href="<?=site_url('admini/order')?>">订单管理</a></span>
        <span class="crumb-step">&gt;</span><span class="crumb-name">商品信息</span>
    </div>
</div>
        <div class="basic_information">
			<div class="basic_information1">
				<div class="basic_infor">基本信息</div>
				<?php if($res['status'] < 6):?>
				<div class="edit"><a href="javascript:set_status();">编辑</a></div>
				<?php endif;?>
			</div>
			<div class="basic_information2">
				<table class="basic_tab" width="100%" border="1">
				  <tr>
					<td width="8%">订单号：</td>
					<td width="37%"><?=$res['order_id']?></td>
					<td width="8%">收货人:</td>
					<td width="37%"><?=$cust['c_name']?></td>
				  </tr>
				  <tr>
					<td width="8%">支付方式：</td>
					<td width="37%"><?=empty($payin) ? '未选择' : $payin ?></td>
					<td width="8%">配送方式:</td>
					<td width="37%"><?=$cust['city_name'][0]['class_id'] == 1 ? '国内配送' : '其他'?></td>
				  </tr>
<!-- 				  <tr> -->
<!-- 					<td width="8%">物流公司:</td> -->
<!-- 					<td width="37%">某某物流公会四</td> -->
<!-- 					<td width="8%">快递单号:</td> -->
<!-- 					<td width="37%">12345678910</td> -->
<!-- 				  </tr> -->
				  <tr>
					<td width="8%">订单状态:</td>
					<td class="order_status" width="37%" style="" id="e_status"><a href="javascript:;"><?=$res['status_name']?></a></td>
					<td class="order_status" width="37%" style="display: none;" id="s_status">
						<select onchange="set_order(this.value)">
							<option value="1"><?=$res['status_name']?></option>
							<option value="6">订单关闭</option>
							<option value="7">订单无效</option>
							<option value="8">退款/售后</option>
						</select>
					</td>
					<td width="8%">下单时间:</td>
					<td width="37%"><?=date('Y-m-d H:i:s',$res['create_time'])?></td>
				  </tr>
				  <tr>
					<td width="8%" title="状态更改时间">操作时间:</td>
					<td width="37%"><?=date('Y-m-d H:i:s',$res['endtime'])?></td>
					<td width="8%">发货时间:</td>
					<td width="37%">未发货</td>
				  </tr>
				  <tr>
					<td width="8%">支付单号:</td>
					<td width="37%"><?=$res['payment']?></td>
					<td width="8%">订单备注：</td>
					<td width="37%">发货快递，注意不要破损</td>
				  </tr>
				 
				 
<!-- 				  <tr class="source"> -->
<!-- 					<td width="8%">订单来源：</td> -->
<!-- 					<td width="37%">某某电器实体店</td>  -->
<!-- 					<td></td> -->
<!-- 					<td></td> -->
<!-- 				  </tr> -->
				</table>

			</div>
		</div>
       
	   <!--佣金-->
<!-- 	   		<div class="commission"> -->
<!-- 				<div class="commission1"> -->
<!-- 					<div class="commission_infor">佣金信息</div> -->
<!-- 					<div class="edit"><a href="#">编辑</a></div> -->
<!-- 				</div> -->
<!-- 				<div class="commission2"> -->
<!-- 					<table class="commission_tab" width="100%" border="1"> -->
<!-- 					  <tr> -->
<!-- 						<td class="shop_name">实体店名称</td> -->
<!-- 						<td class="sales_commission">销售佣金</td> -->
<!-- 					  </tr> -->
<!-- 					  <tr> -->
<!-- 						<td>某某的店</td> -->
<!-- 						<td>4.59</td> -->
<!-- 					  </tr> -->
<!-- 					  <tr> -->
<!-- 						<td>陶小贱的小店（上级）</td> -->
<!-- 						<td>3.06</td> -->
<!-- 					  </tr> -->
<!-- 					  <tr> -->
<!-- 						<td>买得网商城（上上级）</td> -->
<!-- 						<td>1.53</td> -->
<!-- 					  </tr> -->
<!-- 					</table> -->
	
	
<!-- 				</div> -->
<!-- 		</div> -->
		
		 <!--收货人信息-->
	   		<div class="consignee_information">
				<div class="consignee_information1">
					<div class="consignee_infor">收货人信息</div>
<!-- 					<div class="edit"><a href="#">编辑</a></div> -->
				</div>
				<div class="consignee_information2">
					<table class="consignee_tab" width="100%">
						  <tr>
							<td class="consignee" width="10%">收货人：</td>
							<td width="20%"><?=$cust['c_name']?></td>
							<td class="telephone" width="10%">电话：</td>
							<td width="20%"><?=$cust['c_phone']?></td>
							<td class="zip_code" width="10%">邮编：</td>
							<td width="20%"><?=$cust['code']?></td>
						  </tr>
					  </table>
					  <table class="consignee_tab" width="100%">
						  <tr>
							<td class="area" width="11%">地区：</td>
							<td>
								<?php foreach ($cust['city_name'] as $k => $v):?>
									<?=$v['class_name']?>
								<?php endforeach;?>
							</td>
						  </tr>
						  <tr>
							<td class="address" width="11%">地址：</td>
							<td><?=$cust['address']?></td>
						  </tr>
					 
					</table>
	
	
				</div>
		</div>
		
		 <!--商品信息-->
	   		<div class="commodity_information">
				<div class="commodity_information1">
					<div class="commodity_infor">商品信息</div>
<!-- 					<div class="edit"><a href="#">编辑</a></div> -->
				</div>
				<div class="commodity_information2">
					<table class="commodity_tab" width="100%" border="1">
					  <tr>
						<td class="commodity_td">商品名称</td>
						<td class="commodity_td">所属分类</td>
						<td class="commodity_td">品牌</td>
						<td class="commodity_td">配件</td>
						<td class="commodity_td">价格</td>
						<td class="commodity_td">属性</td>
						<td class="commodity_td">数量</td>
<!-- 						<td class="commodity_td">促销</td> -->
					  </tr>
					  <?php $amount = 0; //设置价格余额 ?>
					  <?php foreach($goods as $k => $v):?>
					  <tr class="commodity_tr">
						<td><?=$v['goods']['name']?></td>
						<td><?=$v['goods']['sort_name']?></td>
						<td><?=$v['goods']['brand']?></td>
						<td><?=$v['goods']['packaging']?></td>
						<td><?=$v['price']?></td>
						<td>
							<?php foreach ($v['goods_value'] as $value):?>
							<?=$value['key'].' : '.$value['val']?><br /> 
							<?php endforeach;?>
						</td>
						<td><?=$v['num']?></td>
<!-- 						<td>0</td> -->
					  </tr>
					  <?php $amount += $v['price'] ;?>
					  <?php endforeach;?>
					</table>

	
				</div>
		</div>
	   
	    <!--费用信息-->
	   		<div class="cost">
				<div class="cost1">
					<div class="cost_infor">费用信息</div>
<!-- 					<div class="edit"><a href="#">编辑</a></div> -->
				</div>
				<div class="cost2">
			
		<table class="cost_tab" width="100%" border="1">
		  <tr>
			<td class="cost_td" width="20%">商品总价：</td>
			<td><?=$amount ?></td>
		  </tr>
		  <tr>
			<td class="cost_td">运费：</td>
			<td>0.00</td>
		  </tr>
		  <tr>
			<td class="cost_td">订单总价:</td>
			<td><?=$amount ?></td>
		  </tr>
		  
</table>
	</div>
		</div>
		
		
		<div class="button">
		<?php if(!empty($res['action'])):?>
			<div class="payment_button"><a href="javascript:set_order(<?=$res['action']['status']?>);"><?=$res['action']['status_name']?></a></div>
		<?php endif;?>
			<div class="cancel"><a href="javascript:history.go(-1);">取消</a></div>
		</div>
		
		
		
<script>
/**
 * 更改
 */
function set_status(){
	$('.edit').html('<a href="javascript:end_status();">保存</a>');
	$('#e_status').attr('style','display: none;');
	$('#s_status').attr('style','');
}

/**
 * 关闭
 */
function end_status(){
	$('.edit').html('<a href="javascript:set_status();">保存</a>');
	$('#s_status').attr('style','display: none;');
	$('#e_status').attr('style','');
}

/**
 * 设置订单
 */
function set_order(status){
	if(status == 1){
		return false;
	}
	layer.confirm('该操作不可逆，请核实订单信息', {
	    btn: ['确定','取消'], //按钮
		icon: 0,
	}, function(){
	    $.post("<?=site_url('admini/order/set_status')?>",{oid:<?=$res['id']?>,status:status},function(res){
	    	if(res == 1){
                layer.alert('属性修改成功！刷新可查看效果！',{
                    icon:1,
                },function(){
                	location.reload();
                });
            }else{
                layer.alert(res,{
                    icon:2,
                });
            }
		});
	});
}
</script>